package cn.buk.tms.car.service;


import cn.buk.common.JsonResult;
import cn.buk.tms.entity.misc.OperationLog;
import cn.buk.tms.car.dto.CarOrderDto;
import cn.buk.tms.car.dto.CarOrderRequestDto;
import cn.buk.tms.car.sc.SearchCarOrderCriteria;

import java.util.List;

public interface RentalCarService {

    /**
     * 创建租车订单
     * @param enterpriseId
     * @param username
     * @param dto
     * @return
     */
    JsonResult createRentalCarOrder(int enterpriseId, String username, CarOrderRequestDto dto);

    List<CarOrderDto> searchRentalCarOrders(int enterpriseId, SearchCarOrderCriteria sc);

    CarOrderDto searchRentalCarOrder(int enterpriseId, int orderId);

    /**
     * 客户自行取消租车订单
     *
     * @param enterpriseId
     * @param username
     * @param orderId
     * @return
     */
    JsonResult cancelRentalCarOrder(int enterpriseId, String username, int orderId);

    List<OperationLog> searchRentalCarOrderHistory(int enterpriseId, int orderId);

    /**
     * 修改租车订单价格
     *
     * @param enterpriseId
     * @param username
     * @param orderId
     * @param price
     * @param discount
     * @param cost
     * @return
     */
    JsonResult updateRentalOrderPrice(int enterpriseId, String username, int orderId, double price, double discount, double cost);

    /**
     * 修改供应商
     *
     * @param enterpriseId
     * @param username
     * @param orderId
     * @param supplierId
     * @param paymentMethodId
     * @return
     */
    JsonResult updateRentalCarOrderSupplier(int enterpriseId, String username, int orderId, int supplierId, int paymentMethodId);

    JsonResult updateRentalCarOrderPaymentMethod(int enterpriseId, String username, int orderId, int paymentMethodId);

    JsonResult processRentalCarOrder(int enterpriseId, String username, int orderId);

    JsonResult finishRentalOrder(int enterpriseId, String username, int orderId, String remark);

    /**
     * 检查租车订单是否符合企业差旅规定
     *
     * @param ownerId
     * @param agentName
     */
    void checkRentalCarOrderMeetPolicy(int ownerId, String agentName);

    void checkRentalCarOrderNeedApprover(int ownerId, String agentName);

    /**
     * 回滚租车订单
     * @param enterpriseId
     * @param username
     * @param orderId
     * @param remark
     * @return
     */
    JsonResult rollbackOrder(int enterpriseId, String username, int orderId, String remark);

    /**
     * 修改租车订单的指定字段的内容
     * @param enterpriseId
     * @param username
     * @param orderId
     * @param contentType
     * @param content
     * @return
     */
    JsonResult updateRentalCarOrder(int enterpriseId, String username, int orderId, int contentType, String content);
}
